home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / gpt32src.zip / KYO.TRM < prev    next >
Text File  |  1992-03-25  |  2KB  |  112 lines

  1. /*
  2.  * $Id: kyo.trm,v 3.26 92/03/24 22:35:36 woo Exp Locker: woo $
  3.  */
  4.  
  5. /* Prescribe (KYOCERA) driver - Michael Waldor */
  6. /* Modified for gnuplot 2.0 sk@sun4 24-Apr-1990 13:23 */
  7. #ifdef PRESCRIBE
  8.  
  9. #define PRE_XMAX 2567
  10. #define PRE_YMAX 1815    /* X:Y = sqrt(2) */
  11.  
  12. #define PRE_XLAST (PRE_XMAX - 1)
  13. #define PRE_YLAST (PRE_YMAX - 1)
  14.  
  15. #define PRE_VCHAR (PRE_YMAX/30)
  16. #define PRE_HCHAR 33    /* about 9 chars per inch */
  17. #define PRE_HTIC (PRE_XMAX/80)
  18. #define PRE_VTIC PRE_HTIC
  19.  
  20. /* for Courier font: */
  21. #define KYO_VCHAR (14*(300/72))    /* 12 pt + 2 pt baselineskip */
  22. #define KYO_HCHAR (300/10)    /*  10 chars per inch */
  23.  
  24. enum JUSTIFY pre_justify=LEFT;    /* text is flush left */
  25.  
  26. PRE_init()
  27. {
  28.   (void) fprintf(outfile,"!R! RES;\n") ;
  29.   /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
  30.   /* SPO: landscape format */
  31.   /* STM, SLM set top, left margin*/
  32.   /* Font: bold Helvetica (proportional font) */
  33.   (void) fprintf(outfile,"PAGE; UNIT D; SPO L; STM 280; SLM 440;\n") ;
  34.   (void) fprintf(outfile,"FTMD 15; FONT 29; SCPI 9;\n") ;
  35. }
  36.  
  37. KYO_init()
  38. {
  39.   (void) fprintf(outfile,"!R! RES;\n") ;
  40.   /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
  41.   /* SPO: landscape format */
  42.   /* STM, SLM set top, left margin */
  43.   /* Font: Courier (fixed width font) */
  44.   (void) fprintf(outfile,"PAGE; UNIT D; SPO L; STM 280; SLM 440;\n") ;
  45.   (void) fprintf(outfile,"FTMD 15; FONT 17; SCPI 10;\n") ;
  46. }
  47.  
  48. PRE_graphics()
  49. {
  50. }
  51.  
  52. PRE_text()            /* eject page after each plot */
  53. {
  54.   (void) fprintf(outfile,"PAGE;\n") ; 
  55. }
  56.  
  57. PRE_linetype(linetype)
  58. int linetype ;
  59. {
  60.   /* actually choose pendiameter */
  61.   if (linetype < 0) linetype = -linetype;
  62.   else linetype = 3;
  63.   (void) fprintf(outfile,"SPD %d;\n", linetype) ;
  64. }
  65.  
  66. PRE_move(x,y)
  67. unsigned int x,y ;
  68. {
  69.   (void) fprintf(outfile,"MAP %1d,%1d;\n",x,PRE_YMAX-y) ;
  70. }
  71.  
  72. PRE_vector(x,y)
  73. unsigned int x,y ;
  74. {
  75.   (void) fprintf(outfile,"DAP %1d, %1d;\n",x,PRE_YMAX-y) ;
  76. }
  77.  
  78. PRE_put_text(x, y, str)
  79. unsigned int x,y ;
  80. char *str;
  81. {
  82.   PRE_move(x,y);
  83.   switch(pre_justify){
  84.   case RIGHT:
  85.     (void) fprintf(outfile,"RTXT \"%s\", B;\n",str) ;
  86.     break;
  87.   default:
  88.     (void) fprintf(outfile,"TEXT \"%s\", B;\n",str) ;
  89.   }
  90. }
  91.  
  92. int PRE_justify_text(mode)
  93. enum JUSTIFY mode;
  94. {
  95.   pre_justify=mode;
  96.   switch(pre_justify){
  97.   case LEFT:
  98.   case RIGHT:
  99.     return(TRUE);
  100.   default:
  101.     return(FALSE);
  102.   }
  103.   
  104. }
  105.  
  106. PRE_reset()
  107. {
  108.   (void) fprintf(outfile,"PAGE; RES; EXIT;\n");
  109. }
  110.  
  111. #endif /* PRESCRIBE */
  112.